<?php defined('SYSPATH') or die('No direct access allowed.');
/**
 * @file init.php
 * @brief 包含所有的业务逻辑层组件
 * @author Lionel Tsai
 * @version 1.0
 * @date 2012-02-20
 */
Kohana::modules( array_merge(
	Kohana::modules(),
	array(
		'bt-auth' => MODPATH.'bt-auth',			//application authority
		'userguide'  => MODPATH.'userguide',  // User guide and API documentation
		'orm'        => MODPATH.'orm',        // Object Relationship Mapping
		'auth'       => MODPATH.'auth',       // Basic authentication
		'cache'      => MODPATH.'cache',      // Caching with multiple backends
		// 'codebench'  => MODPATH.'codebench',  // Benchmarking tool
		'database'   => MODPATH.'database',   // Database access
		// 'image'      => MODPATH.'image',      // Image manipulation

	)
   ));

/**
 * @brief 定义BTAPI,如果 bt-api_app使用则BTAPI = '',否则，BTAPI = 'bt-api/'
 *
 * @param 
 * @param 'bt-api'
 */
defined('BTAPI') or define('BTAPI', 'bt-api/');

//登入退出路由
Route::set('btpassport', BTAPI . '<action>', array('action' => 'login|logout'))
 ->defaults(array(
		'controller'	=> 'userpass',
		'action'		=> 'login'    
	   ));
//BTAPI 路由
Route::set('btapi', BTAPI . '(<controller>)(/<id>)(/<action>)(/<id2>)', array('action' => '\D[^\/]*', 'id' => '\d+', 'id2' => '(\d+,?)+'))
->defaults(array(
	'controller'	=> 'welcome',
	'action'		=> 'index',
));


